// Copyright (c) 2008 Matthew Johnson
// Licensed under the MIT License (see license.txt)
package actionml.animation {
	class AlphaTweenRenderer extends PropertyTweenRenderer {
		public static function isApplicable(targetClass:Class, property:String) {
			return property == "alpha";
		}
		public function AlphaTweenRenderer(target:Object, property:String, start:Number, end:Number, tween:Tween) {
			super(target, property, start, end, tween);
		}
		public override function prepareToRender() {
			super.prepareToRender();
			if (!_tween.noAutoVisible && _renderStart == 0 && _renderDistance > 0) {
				_target["visible"] = true;
			}
		}
		internal override function renderLastFrame(rc:RenderContext) {
			super.renderLastFrame(rc);
			if (_target["alpha"] == 0 && !_tween.noAutoVisible) {
				_target["visible"] = false;
			}
		}
	}
}